import { createRouter, createWebHashHistory } from 'vue-router'
import Layout from '../components/Layout.vue'
 const routes = [
    {
        path: '/login',
        component: () => import('../view/Login.vue'),
        meta: { title: '登录' }
    },
    {
        path: '/',
        component: Layout,
        mate: { title: '首页' },
        children: [
            {
                path: 'home',
                mate: { title: '首页' },
                component: () => import('../view/Home.vue')
            }
        ]
    },
    {
        path:'/teacher',
        component:Layout,
        mate:{title:'讲师'},
        children:[
            {
                path: 'list',
                mate: { title: '讲师列表' },
                component: () => import('../view/teacher/list.vue')
            },
            {
                path: 'create',
                mate: { title: '添加讲师' },
                component: () => import('../view/teacher/from.vue')
            }
        ]
    },
    {
        path:'/course',
        component:Layout,
        mate:{title:'课程'},
        children:[
            {
                path: 'list',
                mate: { title: '课程列表' },
                component: () => import('../view/course/list.vue')
            },
            {
                path: 'create',
                mate: { title: '添加课程' },
                component: () => import('../view/course/from.vue')
            }
        ]
    }
]
//创建路由createRoulter
const router=createRouter({
    history:createWebHashHistory(),
    routes
})

export default router